CREATE TABLE [dbo].[tb_AcumulacionDeTitulos]
(
[Titulo1] [int] NOT NULL,
[Titulo2] [int] NOT NULL,
[CargoGenerico] [int] NOT NULL,
[AsignaturaGenerica] [int] NOT NULL,
[ValorDeAcumulacion] [int] NOT NULL,
[idAcumulacion] [int] NOT NULL IDENTITY(1, 1),
[idAnterior] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] ADD CONSTRAINT [PK_tb_AcumulacionDeTitulos] PRIMARY KEY CLUSTERED  ([idAcumulacion]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] WITH NOCHECK ADD CONSTRAINT [FK_tb_AcumulacionDeTitulos_tb_AsignaturasGenericas] FOREIGN KEY ([AsignaturaGenerica]) REFERENCES [dbo].[tb_AsignaturasGenericas] ([idAsignaturaGenerica])
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] WITH NOCHECK ADD CONSTRAINT [FK_tb_AcumulacionDeTitulos_tb_CargosGenericos] FOREIGN KEY ([CargoGenerico]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] WITH NOCHECK ADD CONSTRAINT [FK_tb_AcumulacionDeTitulos_tb_Titulos] FOREIGN KEY ([Titulo1]) REFERENCES [dbo].[tb_Titulos] ([idTitulo])
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] WITH NOCHECK ADD CONSTRAINT [FK_tb_AcumulacionDeTitulos_tb_Titulos1] FOREIGN KEY ([Titulo2]) REFERENCES [dbo].[tb_Titulos] ([idTitulo])
GO
ALTER TABLE [dbo].[tb_AcumulacionDeTitulos] WITH NOCHECK ADD CONSTRAINT [FK_tb_AcumulacionDeTitulos_tb_ValoresDeAcumulacion] FOREIGN KEY ([ValorDeAcumulacion]) REFERENCES [dbo].[tb_ValoresDeAcumulacion] ([idValorAcumulacion])
GO
GRANT REFERENCES ON  [dbo].[tb_AcumulacionDeTitulos] TO [adm-sage]
GRANT SELECT ON  [dbo].[tb_AcumulacionDeTitulos] TO [adm-sage]
GRANT INSERT ON  [dbo].[tb_AcumulacionDeTitulos] TO [adm-sage]
GRANT DELETE ON  [dbo].[tb_AcumulacionDeTitulos] TO [adm-sage]
GRANT UPDATE ON  [dbo].[tb_AcumulacionDeTitulos] TO [adm-sage]
GO
